#ifndef IMAGESAVEWORKERTHREAD_H
#define IMAGESAVEWORKERTHREAD_H

#include <QObject>
#include <QThread>
#include <QDateTime>
#include "HalconCpp.h"

#pragma pack(1)
typedef struct _IMAGE_SAVE_THREAD_CTX
{
	QList<HalconCpp::HImage> imagePadList;
	QList<HalconCpp::HImage> imageCapList;
	QList<HalconCpp::HImage> imageSubList;
	QString lotId;
	QDateTime time;
	//  QString path;
	HalconCpp::HImage imageResult;
	int result;
	int chipType; //0 bga 1 lga
}IMAGE_SAVE_THREAD_CTX;
#pragma pack()

class ImageSaveWorkerThread : public QThread
{
    Q_OBJECT
 

public:
    explicit ImageSaveWorkerThread(QObject *parent = nullptr);
    void SetLotAndDate(QString lot, QString date);
    void AddImageList(QList<HalconCpp::HImage> imagePadList, QList<HalconCpp::HImage> imageCapList, QList<HalconCpp::HImage> imageSubList, QString lotName, QDateTime time, int result, HalconCpp::HImage imageResult, int chipType);
signals:

public slots:

protected:
    void run();
    QString m_LotName;
    QString m_Date;
    QList<IMAGE_SAVE_THREAD_CTX> m_listCtx;
    void DoSaveImage(IMAGE_SAVE_THREAD_CTX ctx);
};

#endif // IMAGESAVEWORKERTHREAD_H
